<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h4>链接列表</h4>
<a href="./tag">到标签列表</a>
<a href="javascript:confirm('确定注销？')?location.href='./logout':false;" >注销</a>
<ul>
	<?php foreach($links as $link): ?>
		<li style="word-wrap:break-word;word-break:break-all">
			<?php echo $link['name'] ?>：<?php echo $link['link'] ?>
			<a href="./link_detail?id=<?php echo $link['id'] ?>" style="display:inline-block;margin-right:20px;">详情</a>
			<a href="javascript:confirm('确定删除？')?location.href='./link_del?id=<?php echo $link['id'] ?>':false;">删除</a>
		</li>
	<?php endforeach ?>
</ul>

<h4>添加链接</h4>
<form action="./link_add" method="post">
	<label for="name">名称</label>
	<input type="text" name="name" />
	<label for="link">链接</label>
	<input type="text" name="link" />
	<input type="submit" value="提交" />
</form>

<p style="font-family: '宋体';font-size: 12px;color:red;">
	注意：链接需要加上“http://”
</p>

</body>
</html>